#include<stdio.h>

int Fun(int n)
{
	int a,b,s=0;
	b=n;
	while (n!=0)
	{
		a=n%10;
		s+=a*a*a;
		n=n/10;
	}
	if (s==b)
		return 1;
	else
		return 0;
}

int main()
{
	int n,x;
	while (scanf("%d",&n)==1)
	{
		x=Fun(n);
		if (x)	
			printf("Yes\n");
		else
			printf("No\n");
	}
	return 0;
}
